const { defineConfig } = require("@vue/cli-service");

module.exports = defineConfig({
  devServer: {
    proxy: {
      "/api": {
        target: "http://localhost:18082/",
        changeOrigin: true,
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
  transpileDependencies: ["ant-design-vue"],
  configureWebpack: async (config) => {
    const { default: Components } = await import(
      "unplugin-vue-components/webpack"
    );
    const { AntDesignVueResolver } = await import(
      "unplugin-vue-components/resolvers"
    );

    config.plugins.push(
      Components({
        resolvers: [
          AntDesignVueResolver({
            importStyle: "css",
          }),
        ],
        dts: true,
      })
    );
  },
});
